//
//  MiningTotalNumCell.m
//  ShandsMod
//
//  Created by zh_s on 2023/3/22.
//  Copyright © 2023 zh_s. All rights reserved.
//

#import "MiningTotalNumCell.h"

@implementation MiningTotalNumCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.accessoryType = UITableViewCellAccessoryNone;
        self.backgroundColor = [UIColor clearColor];
        [self createView];
    }
    return self;
}


- (void)createView {
    
    UIView *backView = [[UIView alloc] init];
    [self.contentView addSubview:backView];
    backView.frame = CGRectMake(20, 0, SCREEN_WIDTH - 40, 140);
    [backView.layer addSublayer:[UIColor setGradualChangingColor:backView fromColor:@"5689F6" toColor:@"A8C4FF"]];
    GWRadius(backView, 13);
    
    UIView *Shadow = [[UIView alloc] init];
    [self.contentView addSubview:Shadow];
    Shadow.backgroundColor = RGB(86, 137, 246);
    Shadow.frame = CGRectMake(20, 0, SCREEN_WIDTH - 40, 140);
    [Shadow settingRadiusWithShadowOpacity:0.5 withShadowColor:RGB(86, 137, 246) wihtShadowRadius:10 withshadowOffset:CGSizeMake(3, 3) withRadius:13];
    
    
    UIView *backV = [[UIView alloc] init];
    [self.contentView addSubview:backV];
    backV.frame = CGRectMake(20, 0, SCREEN_WIDTH - 40, 140);
    backV.backgroundColor = UIColor.clearColor;
    

    UILabel *allNumLab = [[UILabel alloc] init];
    [backV addSubview:allNumLab];
    allNumLab.textColor = UIColor.whiteColor;
    allNumLab.font = FONT_NAME(@"DINCond-Bold", 38);
    allNumLab.text = @"364999";
    [allNumLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(24);
        make.top.mas_equalTo(13);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 53));
    }];
    
    UILabel *allNumExplainL = [[UILabel alloc] init];
    [backV addSubview:allNumExplainL];
    allNumExplainL.textColor = RGBA(255, 255, 255, 0.5);
    allNumExplainL.font = FONT_NAME(FONT_Regular, 12);
    allNumExplainL.text = @"全网矿池数量";
    [allNumExplainL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(24);
        make.top.mas_equalTo(58);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 22));
    }];
    
    UILabel *todayNumLab = [[UILabel alloc] init];
    [backV addSubview:todayNumLab];
    todayNumLab.textColor = RGBA(255, 255, 255, 1);
    todayNumLab.font = FONT_NAME(@"DINCond-Bold", 12);
    todayNumLab.text = @"20890";
    [todayNumLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(26);
        make.top.mas_equalTo(91);
        make.height.mas_equalTo(14);
//        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH -200, 14));
    }];
    UILabel *todayExplainLab = [[UILabel alloc] init];
    [backV addSubview:todayExplainLab];
    todayExplainLab.textColor = RGBA(255, 255, 255, 0.5);
    todayExplainLab.font = FONT_NAME(FONT_Semibold, 10);
    todayExplainLab.text = @"今日产出";
    [todayExplainLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(todayNumLab.mas_left);
        make.top.mas_equalTo(todayNumLab.mas_bottom).mas_offset(7);
        make.height.mas_equalTo(10);
//        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH -200, 14));
    }];

    UIView *lineV = [BaseViewFactory viewWithFrame:CGRectZero color:UIColor.whiteColor];
    [backV addSubview:lineV];
    [lineV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(todayNumLab.mas_right).mas_offset(20);
        make.top.mas_equalTo(88);
        make.height.mas_equalTo(17);
        make.width.mas_equalTo(1);
    }];
    
    UILabel *networkNumLab = [[UILabel alloc] init];
    [backV addSubview:networkNumLab];
    networkNumLab.textColor = RGBA(255, 255, 255, 1);
    networkNumLab.font = FONT_NAME(@"DINCond-Bold", 16);
    networkNumLab.text = @"20890";
    [networkNumLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(lineV.mas_right).mas_offset(20);
        make.top.mas_equalTo(91);
        make.height.mas_equalTo(14);
//        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH -200, 14));
    }];
    
    UILabel *networkExplainLab = [[UILabel alloc] init];
    [backV addSubview:networkExplainLab];
    networkExplainLab.textColor = RGBA(255, 255, 255, 0.5);
    networkExplainLab.font = FONT_NAME(FONT_Semibold, 10);
    networkExplainLab.text = @"今日产出";
    [networkExplainLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(networkNumLab.mas_left);
        make.top.mas_equalTo(networkNumLab.mas_bottom).mas_offset(7);
        make.height.mas_equalTo(10);
//        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH -200, 14));
    }];

    UIImageView *arrowImage = [[UIImageView alloc] init];
    [backV addSubview:arrowImage];
    arrowImage.image = IMAGE_NAME(@"icon_test_wallet");
    [arrowImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(backV.mas_right).mas_offset(- 10);
        make.top.mas_equalTo(13);
        make.size.mas_equalTo(CGSizeMake(117, 105));
    }];

}

@end
